<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>killerbee.kbutils</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="killerbee-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/killerbee/">KillerBee</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="killerbee-module.html">Package&nbsp;killerbee</a> ::
        Module&nbsp;kbutils
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="killerbee.kbutils-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module kbutils</h1><p class="nomargin-top"><span class="codelink"><a href="killerbee.kbutils-pysrc.html">source&nbsp;code</a></span></p>
<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Classes"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="killerbee.kbutils.KBCapabilities-class.html" class="summary-name">KBCapabilities</a><br />
      Class to store and report on the capabilities of a specific 
        KillerBee device.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="killerbee.kbutils.findFromList-class.html" class="summary-name">findFromList</a><br />
      Custom matching function for pyUSB 1.x.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="killerbee.kbutils.findFromListAndBusDevId-class.html" class="summary-name">findFromListAndBusDevId</a><br />
      Custom matching function for pyUSB 1.x.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="killerbee.kbutils.KBException-class.html" class="summary-name">KBException</a><br />
      Base class for all KillerBee specific exceptions.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="killerbee.kbutils.KBInterfaceError-class.html" class="summary-name">KBInterfaceError</a><br />
      Custom exception for KillerBee having issues communicating with an 
        interface, such as opening a port, syncing with the firmware, etc.
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#devlist_usb_v1x" class="summary-sig-name">devlist_usb_v1x</a>(<span class="summary-sig-arg">vendor</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">product</span>=<span class="summary-sig-default">None</span>)</span><br />
      Private function.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#devlist_usb_v1x">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#devlist_usb_v0x" class="summary-sig-name">devlist_usb_v0x</a>(<span class="summary-sig-arg">vendor</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">product</span>=<span class="summary-sig-default">None</span>)</span><br />
      Private function.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#devlist_usb_v0x">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="isIpAddr"></a><span class="summary-sig-name">isIpAddr</span>(<span class="summary-sig-arg">ip</span>)</span><br />
      Return True if the given string is a valid IPv4 or IPv6 address.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#isIpAddr">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">List</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#devlist" class="summary-sig-name">devlist</a>(<span class="summary-sig-arg">vendor</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">product</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">gps</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">include</span>=<span class="summary-sig-default">None</span>)</span><br />
      Return device information for all present devices, filtering if 
      requested by vendor and/or product IDs on USB devices, and running 
      device fingerprint functions on serial devices.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#devlist">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_serial_devs"></a><span class="summary-sig-name">get_serial_devs</span>(<span class="summary-sig-arg">seriallist</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#get_serial_devs">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="isSerialDeviceString"></a><span class="summary-sig-name">isSerialDeviceString</span>(<span class="summary-sig-arg">s</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#isSerialDeviceString">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#get_serial_ports" class="summary-sig-name">get_serial_ports</a>(<span class="summary-sig-arg">include</span>=<span class="summary-sig-default">None</span>)</span><br />
      Private function.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#get_serial_ports">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">Tuple</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#isgoodfetccspi" class="summary-sig-name">isgoodfetccspi</a>(<span class="summary-sig-arg">serialdev</span>)</span><br />
      Determine if a given serial device is running the GoodFET firmware 
      with the CCSPI application.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#isgoodfetccspi">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">Boolean</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#iszigduino" class="summary-sig-name">iszigduino</a>(<span class="summary-sig-arg">serialdev</span>)</span><br />
      Determine if a given serial device is running the GoodFET firmware 
      with the atmel_radio application.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#iszigduino">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">Boolean</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#isfreakduino" class="summary-sig-name">isfreakduino</a>(<span class="summary-sig-arg">serialdev</span>)</span><br />
      Determine if a given serial device is a Freakduino attached with the 
      right sketch loaded.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#isfreakduino">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="search_usb"></a><span class="summary-sig-name">search_usb</span>(<span class="summary-sig-arg">device</span>)</span><br />
      Takes either None, specifying that any USB device in the global 
      vendor and product lists are acceptable, or takes a string that 
      identifies a device in the format 
      &lt;BusNumber&gt;:&lt;DeviceNumber&gt;, and returns the pyUSB objects
      for bus and device that correspond to the identifier string.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#search_usb">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="search_usb_bus_v0x"></a><span class="summary-sig-name">search_usb_bus_v0x</span>(<span class="summary-sig-arg">bus</span>,
        <span class="summary-sig-arg">busNum</span>,
        <span class="summary-sig-arg">devNum</span>)</span><br />
      Helper function for USB enumeration in pyUSB 0.x enviroments.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#search_usb_bus_v0x">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">String</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#hexdump" class="summary-sig-name">hexdump</a>(<span class="summary-sig-arg">src</span>,
        <span class="summary-sig-arg">length</span>=<span class="summary-sig-default">16</span>)</span><br />
      Creates a tcpdump-style hex dump string output.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#hexdump">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">String</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#randbytes" class="summary-sig-name">randbytes</a>(<span class="summary-sig-arg">size</span>)</span><br />
      Returns a random string of size bytes.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#randbytes">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">String</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#randmac" class="summary-sig-name">randmac</a>(<span class="summary-sig-arg">length</span>=<span class="summary-sig-default">8</span>)</span><br />
      Returns a random MAC address using a list valid OUI's from ZigBee 
      device manufacturers.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#randmac">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="killerbee.kbutils-module.html#makeFCS" class="summary-sig-name">makeFCS</a>(<span class="summary-sig-arg">data</span>)</span><br />
      Do a CRC-CCITT Kermit 16bit on the data given Implemented using 
      pseudocode from: June 1986, Kermit Protocol Manual See also: 
      http://regregex.bbcmicro.net/crc-catalogue.htm#crc.cat.kermit</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="killerbee.kbutils-pysrc.html#makeFCS">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="USBVER"></a><span class="summary-name">USBVER</span> = <code title="1">1</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="RZ_USB_VEND_ID"></a><span class="summary-name">RZ_USB_VEND_ID</span> = <code title="1003">1003</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="RZ_USB_PROD_ID"></a><span class="summary-name">RZ_USB_PROD_ID</span> = <code title="8458">8458</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="ZN_USB_VEND_ID"></a><span class="summary-name">ZN_USB_VEND_ID</span> = <code title="1240">1240</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="ZN_USB_PROD_ID"></a><span class="summary-name">ZN_USB_PROD_ID</span> = <code title="14">14</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="FTDI_X_USB_VEND_ID"></a><span class="summary-name">FTDI_X_USB_VEND_ID</span> = <code title="1027">1027</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="FTDI_X_USB_PROD_ID"></a><span class="summary-name">FTDI_X_USB_PROD_ID</span> = <code title="24597">24597</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="usbVendorList"></a><span class="summary-name">usbVendorList</span> = <code title="[1003, 1240]"><code class="variable-group">[</code>1003<code class="variable-op">, </code>1240<code class="variable-group">]</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="usbProductList"></a><span class="summary-name">usbProductList</span> = <code title="[8458, 14]"><code class="variable-group">[</code>8458<code class="variable-op">, </code>14<code class="variable-group">]</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="gps_devstring"></a><span class="summary-name">gps_devstring</span> = <code title="None">None</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'killerbee'"><code class="variable-quote">'</code><code class="variable-string">killerbee</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="devlist_usb_v1x"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">devlist_usb_v1x</span>(<span class="sig-arg">vendor</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">product</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#devlist_usb_v1x">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Private function. Do not call from tools/scripts/etc.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="devlist_usb_v0x"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">devlist_usb_v0x</span>(<span class="sig-arg">vendor</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">product</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#devlist_usb_v0x">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Private function. Do not call from tools/scripts/etc.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="devlist"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">devlist</span>(<span class="sig-arg">vendor</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">product</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">gps</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">include</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#devlist">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Return device information for all present devices, filtering if 
  requested by vendor and/or product IDs on USB devices, and running device
  fingerprint functions on serial devices.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>gps</code></strong> (String) - Optional serial device identifier for an attached GPS unit. If 
          provided, or if global variable has previously been set, 
          KillerBee skips that device in device enumeration process.</li>
        <li><strong class="pname"><code>include</code></strong> (List of Strings) - Optional list of device handles to be appended to the normally 
          found devices. This is useful for providing IP addresses for 
          remote scanners.</li>
    </ul></dd>
    <dt>Returns: List</dt>
        <dd>List of device information present. For USB devices, get 
          [busdir:devfilename, productString, serialNumber] For serial 
          devices, get [serialFileName, deviceDescription, &quot;&quot;]</dd>
  </dl>
</td></tr></table>
</div>
<a name="get_serial_ports"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_serial_ports</span>(<span class="sig-arg">include</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#get_serial_ports">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Private function. Do not call from tools/scripts/etc. This should 
  return a list of device paths for serial devices that we are interested 
  in, aka USB serial devices using FTDI chips such as the TelosB, ApiMote, 
  etc. This should handle returning a list of devices regardless of the 
  *nix it is running on. Support for more *nix and winnt needed.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>include</code></strong> (List of Strings, or None) - A list of device strings, of which any which appear to be serial 
          device handles will be added to the set of serial ports returned 
          by the normal search. This may be useful if we're not including 
          some oddly named serial port which you have a KillerBee device 
          on. Optional.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="isgoodfetccspi"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">isgoodfetccspi</span>(<span class="sig-arg">serialdev</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#isgoodfetccspi">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Determine if a given serial device is running the GoodFET firmware 
  with the CCSPI application. This should either be a TelosB/Tmote Sky 
  GOODFET or an Api-Mote design.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>serialdev</code></strong> (String) - Path to a serial device, ex /dev/ttyUSB0.</li>
    </ul></dd>
    <dt>Returns: Tuple</dt>
        <dd>Tuple with the fist element==True if it is some goodfetccspi 
          device. The second element is the subtype, and is 0 for telosb 
          devices and 1 for apimote devices.</dd>
  </dl>
</td></tr></table>
</div>
<a name="iszigduino"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">iszigduino</span>(<span class="sig-arg">serialdev</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#iszigduino">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Determine if a given serial device is running the GoodFET firmware 
  with the atmel_radio application. This should be a Zigduino (only tested 
  on hardware r1 currently).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>serialdev</code></strong> (String) - Path to a serial device, ex /dev/ttyUSB0.</li>
    </ul></dd>
    <dt>Returns: Boolean</dt>
        <dd>Boolean with the fist element==True if it is a goodfet atmel128 
          device.</dd>
  </dl>
</td></tr></table>
</div>
<a name="isfreakduino"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">isfreakduino</span>(<span class="sig-arg">serialdev</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#isfreakduino">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Determine if a given serial device is a Freakduino attached with the 
  right sketch loaded.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>serialdev</code></strong> (String) - Path to a serial device, ex /dev/ttyUSB0.</li>
    </ul></dd>
    <dt>Returns: Boolean</dt>
  </dl>
</td></tr></table>
</div>
<a name="hexdump"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">hexdump</span>(<span class="sig-arg">src</span>,
        <span class="sig-arg">length</span>=<span class="sig-default">16</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#hexdump">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Creates a tcpdump-style hex dump string output.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>src</code></strong> (String) - Input string to convert to hexdump output.</li>
        <li><strong class="pname"><code>length</code></strong> (Int) - Optional length of data for a single row of output, def=16</li>
    </ul></dd>
    <dt>Returns: String</dt>
  </dl>
</td></tr></table>
</div>
<a name="randbytes"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">randbytes</span>(<span class="sig-arg">size</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#randbytes">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns a random string of size bytes.  Not cryptographically 
  safe.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>size</code></strong> (Int) - Length of random data to return.</li>
    </ul></dd>
    <dt>Returns: String</dt>
  </dl>
</td></tr></table>
</div>
<a name="randmac"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">randmac</span>(<span class="sig-arg">length</span>=<span class="sig-default">8</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#randmac">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns a random MAC address using a list valid OUI's from ZigBee 
  device manufacturers.  Data is returned in air-format byte order (LSB 
  first).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>length</code></strong> (String) - Optional length of MAC address, def=8. Minimum address return 
          length is 3 bytes for the valid OUI.</li>
    </ul></dd>
    <dt>Returns: String</dt>
        <dd>A randomized MAC address in a little-endian byte string.</dd>
  </dl>
</td></tr></table>
</div>
<a name="makeFCS"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">makeFCS</span>(<span class="sig-arg">data</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="killerbee.kbutils-pysrc.html#makeFCS">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Do a CRC-CCITT Kermit 16bit on the data given Implemented using 
  pseudocode from: June 1986, Kermit Protocol Manual See also: 
  http://regregex.bbcmicro.net/crc-catalogue.htm#crc.cat.kermit</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>a CRC that is the FCS for the frame, as two hex bytes in 
          little-endian order.</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="killerbee-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/killerbee/">KillerBee</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Dec 30 17:49:11 2013
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
